package logic

import (
	"context"
	"merchantmanager/models/mysql"

	"merchantmanager/merchantmanagerrpc/internal/svc"
	"merchantmanager/merchantmanagerrpc/merchantmanagerrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type MerchantmanagerDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewMerchantmanagerDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MerchantmanagerDelLogic {
	return &MerchantmanagerDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 删除
func (l *MerchantmanagerDelLogic) MerchantmanagerDel(in *merchantmanagerrpc.MerchantmanagerDelRequest) (*merchantmanagerrpc.MerchantmanagerDelResponse, error) {
	// todo: add your logic here and delete this line

	mysql.DB.Debug().Where("id = ?", in.Id).Delete(&mysql.Merchants{})

	return &merchantmanagerrpc.MerchantmanagerDelResponse{}, nil
}
